from utils.methods import get_code_profit_data
import baostock as bs

if __name__ == '__main__':
    code = 'sh.600900'
    bs.login()
    result_profit = get_code_profit_data(code, 2000, 2025)
    try:
        net_profit_data = result_profit['netProfit']
        # 字符串转换成小数
        net_profit_data = net_profit_data.astype(float)
    except Exception as err:
        print('获取盈利数据失败')
    bs.logout()